<?php

class HTech_Report_Form_Date extends Zend_Form
{
    public function __construct() 
    {
        parent::__construct();        
        
        $this->setName('Date');
        
        $report = new Zend_Form_Element_Hidden('Report');
        
        $date = new Zend_Form_Element_Text('Date');
        $date->setLabel("Date")
            ->setRequired(true)
            ->addValidator('NotEmpty', true, array('messages' => $this->getTranslator()->translate("Required field, can't be empty")))
            ->addPrefixPath('HTech_Validate', 'HTech/Validate', 'validate')
            ->addValidator('Date', true, array(
                'maxDate' => date('Y-m-d'),
                'maxInclusive' => true,
                'messages' => array(
                    'msgMaxDate' => $this->getTranslator()->translate("Maximum date allowed: %maxDate%"),
                    'msgDate' => $this->getTranslator()->translate("Invalid date, valid format: yyyy-mm-dd"),
                    'msgFormat' => $this->getTranslator()->translate("Valid format: yyyy-mm-dd"))));
                              
        $cols = new Zend_Form_Element_Multiselect('Columns');
        $cols->setLabel("Columns")                
            ->setAttrib('size','10')
            ->setRequired(false); 
                
        $submit = new Zend_Form_Element_Submit('Submit');
        $submit->setLabel("Submit")
            ->addDecorator(new HTech_Form_Decorator_Button(array('type' => 'submit'))); 
                                        
        $this->addElements(array($date, $cols, $submit, $report));
    }

}